import Global
from entity.Entrust import EntrustFutures as EntrustFutures1
from entity.Entrust import EntrustStock as EntrustStock1
from entity.Futures import Futures as Futures1
from entity.Holding import HoldingFutures as HoldingFutures1
from entity.Holding import HoldingStock as HoldingStock1
from entity.Stock import Stock as Stock1
from entity.User import User as User1


# 类创建接口
def Futures(code):
    return Futures1(code)


def Stock(code):
    return Stock1(code)


# def HoldingStock(stock, num, buyPrice):
#     return HoldingStock1(stock, num, buyPrice)
#
#
# def HoldingFutures(futures, num, buyPrice, case, pry):
#     return HoldingFutures1(futures, num, buyPrice, case, pry)


# def EntrustStock(stock, num, price):
#     return EntrustStock1(stock, num, price)
#
#
# def EntrustFutures(futures, num, price, case, pry):
#     return EntrustFutures1(futures, num, price, case, pry)


def User(money=10000):
    return User1(money=money)


# 全局函数调用接口
def dayNum(day1, day2):
    return Global.dayNum(day1, day2)


def getMinDate(prod_code, nowDay):
    return Global.getMinDate(prod_code, nowDay)


def getFuturesData(code, start, end):
    return Global.getFuturesData(code, start, end)


def getDayData(prod_code, start, end):
    return Global.getDayData(prod_code, start, end)


def nextDay():
    return Global.nextDay()


def nextMin():
    return Global.nextMin()


def config(startDate_, endDate_):
    Global.config(startDate_, endDate_)
